package 二进制;

/**
 * 2进制前缀0b
 * 16进制前缀0x：权4096 256 16 1
 * 8进制是0开头
 */
public class HexDemo {
    public static void main(String[] args) {
        int n =0b0100_0111_1011_1001_1000_1010;
        int m=0x47b98a;
        int min= 2147483647;
        System.out.println(Integer.toBinaryString(min));
        //按照16进制输出
        System.out.println(Integer.toHexString(n));
        System.out.println(Integer.toHexString(m));
        //按照2进制输出
        System.out.println(Integer.toBinaryString(n));
        System.out.println(Integer.toBinaryString(m));
        //按照10进制输出
        System.out.println(n);
        System.out.println(m);

        int a =067;//0开头代表8进制
        System.out.println(a);//6*8+7
    }
}
